<template>
  <div class="order">
    <header>
      <van-nav-bar
        title="订单"
        left-text="返回"
        right-text=""
        left-arrow
        @click-left="onClickLeft"
        @click-right="onClickRight"
      />
    </header>
    <section>
      <van-tabs v-model="active">
        <van-tab title="全部">
          <Child :msg="allorder"></Child>
        </van-tab>
        <van-tab title="待付款" ></van-tab>
        <van-tab title="待发货">
          <Shipped :msg="shipped"></Shipped>
        </van-tab>
        <van-tab title="待收货">
          <Received :msg="received"></Received>
        </van-tab>
      </van-tabs>
    </section>
   
  </div>
</template>
<script>
import Child from '@/components/orders/allgoods';
import Shipped from '@/components/orders/shipped';
import Received from '@/components/orders/received';
import { Toast, Dialog } from "vant";
export default {
  name:'AllorderView',
  components: {
    Child,Shipped,Received
  },
  data() {
    return {
      active: 0,
      allorder:[],
      shipped:[],
      received:[],
    };
  },
  methods: {
    onClickLeft() {
      this.$router.push({ path: "/my" });
    },
    onClickRight() {
      Toast("按钮");
    },
    //获取用户订单数据
    getOrder(){
      let allorder = JSON.parse(localStorage.getItem("allorder"));
      this.allorder = allorder;
      this.received = allorder;
    },
    
  },
  mounted(){
    this.getOrder();
    // this.onlook()
    // console.log(typeof Symbol(12));
  },
  
};
</script>
<style lang="scss">
</style>